package com.link.base.base.urlinfo.dao.mybatis.mapper;


import com.link.base.base.urlinfo.model.UrlDutyLink;
import com.link.core.basic.dao.mapper.BasicMapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * @author unknown
 * @date unknown
 */
public interface UrlDutyLinkMapper extends BasicMapper<UrlDutyLink> {

    /**
     * 将对应dutyId下，已存在的url可访问设置为'Y'
     *
     * @author cuizhiyong
     * @param urlIds url的id组成的list
     * @param dutyId 职责id
     * @date 2019/4/10 11:13
     */
    void enableLinks(@Param("urlIds") List<Long> urlIds, @Param("dutyId") Long dutyId) throws Exception;

    /**
     * 将对应dutyId下，已存在的url返回
     *
     * @author cuizhiyong
     * @param urlIds url的id组成的list
     * @param dutyId 职责id
     * @date 2019/4/10 11:23
     */
    List<Long> existUrls(@Param("urlIds") List<Long> urlIds, @Param("dutyId") Long dutyId) throws Exception;

    /**
     * 批量插入url和duty中间表数据
     *
     * @author cuizhiyong
     * @param list 待插入数据
     * @date 2019/4/10 11:38
     */
    void batchAdd(List<UrlDutyLink> list) throws Exception;
}
